package com.zxf.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zxf.dao.ColumnsMapper;
import com.zxf.dao.FilesupMapper;
import com.zxf.dao.StaffVoMapper;
import com.zxf.pojo.Columns;
import com.zxf.pojo.Filesup;
import com.zxf.pojo.Params;
import com.zxf.pojo.Staff;
import com.zxf.pojo.StaffVo;

@Service  
//默认将类中的所有函数纳入事务管理.  
@Transactional  
public class FileService {
	
	 
	    @Autowired  
	    private ColumnsMapper columnMapper; 
	    
	    @Autowired  
	    private FilesupMapper filesupMapper; 
	    
	    @Autowired  
	    private StaffVoMapper staffVoMapper; 
	  
	 public void insertUser(Columns column,Map<String,Object> param) {  
	        //新增用户  
		 columnMapper.insert(column);  
	 }

	public Columns getId(int userid) {
		Columns columns = new Columns();
		columns = columnMapper.selectByPrimaryKey(userid);
		return columns;
	}

	public List getUserList() {
		// 用户列表
		List  userList = columnMapper.getColumnList();
		return userList;
	}

	public Map getUserList2() {
		// TODO Auto-generated method stub
		Map<String, Object> userMap = new HashMap<String, Object>();
		userMap= columnMapper.getColumnJson();
		return userMap;
	}

	public int insertFile(Filesup fileUp) {
		return filesupMapper.insertSelective(fileUp);
		
	}

	public void insertSelective(Staff staff) {
		// TODO Auto-generated method stub
		
	}

	public int getrecordSize() {
		// TODO Auto-generated method stub
		return 0;
	}

	public void insertStaffVo(StaffVo staffVo) {
		// TODO Auto-generated method stub
		staffVoMapper.insertSelective(staffVo);
	}
//文件列表
	public List getFilelist(Params params) {
		// TODO Auto-generated method stub
		return filesupMapper.getFilelist(params);
	}
//文件数量
	public int getFiletotle() {
		// TODO Auto-generated method stub
		return filesupMapper.getFiletotle();
	}
}
